package com.example.smartcity

import android.Manifest
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import com.youth.banner.Banner
import java.io.File


class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
//        Thread() {
//            val client = OkHttpClient()
//            val userInfo = UserInfo(userName = "张三", nickName = "哈哈哈", phonenumber = "177749464", sex = "0", password = "123456")
////            RequestBody.create("application/json; charset=utf-8".toMediaType(),Gson().toJson(userInfo))
//            val body = Gson().toJson(userInfo).toRequestBody("application/json; charset=utf-8".toMediaType())
//            val build = Request.Builder().post(body).url("http://192.168.0.101:8081/api/city/system/user/register").build()
//            client.newCall(build).enqueue(object : Callback {
//                override fun onFailure(call: Call, e: IOException) {
//                    print(e.message)
//                }
//
//                override fun onResponse(call: Call, response: Response) {
//                    val string = response.body?.string()
//                    print(string)
//                }
//            })
//        }.start()





    }







    fun editUserInfo(view:View){
        startActivity(Intent(this,EditUserInfoActivity::class.java))
    }







}